import { defineConfig } from "windicss/helpers";
import lineClamp from "windicss/plugin/line-clamp";

const spacing = [...new Array(1000)].reduce((prev, _, i) => {
  prev[i] = `${i}px`;
  return prev;
}, {});
const lineHeight = [...new Array(1000)].reduce((prev, _, i) => {
  prev[i] = `${i}px`;
  return prev;
}, {});
const rounded = [...new Array(1000)].reduce((prev, _, i) => {
  prev[i] = `${i}px`;
  return prev;
}, {});
const fontSize = [...new Array(48)].reduce((prev, _, i) => {
  prev[i + 12] = `${i + 12}px`;
  return prev;
}, {});

export default defineConfig({
  theme: {
    spacing,
    fontSize: {
      ...fontSize,
      base: "14px",
    },
    fontFamily: {
      din: "din",
    },
    extend: {
      colors: {
        primary: "var(--el-color-primary)",
        success: "var(--el-color-success)",
        warning: "var(--el-color-warning)",
        error: "var(--el-color-error)",
        danger: "var(--el-color-danger)",
        info: "var(--el-color-info)",
        main: "var(--realbox-bg-main)",
      },
      height: {},
      lineHeight: {
        ...lineHeight,
      },
      borderRadius: rounded,
    },
  },
  plugins: [lineClamp],
  extract: {
    include: ["index.html", "src/**/*.{vue,ts,js,jsx,tsx,css,less}"],
  },
});
